import {
  provideHttpClient,
  withFetch,
  withInterceptorsFromDi,
} from "@angular/common/http";
import {
  NgModule,
  type OnChanges,
  type OnDestroy,
  type OnInit,
} from "@angular/core";
import { FormsModule } from "@angular/forms";
import { BrowserModule } from "@angular/platform-browser";
import { RouterOutlet } from "@angular/router";
import { PullRefreshComponent } from "./components/pull-refresh.component";
import { RootComponent } from "./root.component";
import { RoutingModule } from "./router/router";

@NgModule({
  declarations: [RootComponent, PullRefreshComponent],
  imports: [BrowserModule, FormsModule, RouterOutlet, RoutingModule],
  exports: [],
  providers: [provideHttpClient(withFetch(), withInterceptorsFromDi())],
  bootstrap: [RootComponent],
})
export class AppModule implements OnInit, OnDestroy, OnChanges {
  ngOnInit(): void {
    console.log("PullRefresh.Init");
  }

  ngOnDestroy(): void {
    console.log("PullRefresh.Destroy");
  }

  ngOnChanges(): void {
    console.log("PullRefresh.Changes");
  }

  constructor() {
    console.log("PullRefresh.Constructor");
  }
}
